home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Components / Microsoft ASP / _SETUP.1 / ASPWizard.jar / asp / wizard / WVPanelDbQueryJoin.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-20  |  5.0 KB  |  116 lines

  1. package asp.wizard;
  2.  
  3. import asp.netobjects.nfx.ui.OrderedListModel;
  4. import asp.util.ResourceUtil;
  5. import asp.wizard.util.UiUtil;
  6. import com.sun.java.swing.BorderFactory;
  7. import com.sun.java.swing.JButton;
  8. import com.sun.java.swing.JComboBox;
  9. import com.sun.java.swing.JLabel;
  10. import com.sun.java.swing.JList;
  11. import com.sun.java.swing.JPanel;
  12. import com.sun.java.swing.JScrollPane;
  13. import java.awt.Color;
  14. import java.awt.Component;
  15. import java.awt.Container;
  16. import java.awt.Dimension;
  17. import java.awt.GridBagConstraints;
  18. import java.awt.GridBagLayout;
  19.  
  20. public class WVPanelDbQueryJoin extends WVPanelBase {
  21.    private static final String ID_LBL_LHSTABLES = "label.lhstables";
  22.    private static final String ID_LBL_RHSTABLES = "label.rhstables";
  23.    private static final String ID_LBL_LHSFIELDS = "label.lhsfields";
  24.    private static final String ID_LBL_RHSFIELDS = "label.rhsfields";
  25.    private static final String ID_LBL_JOINS = "label.joins";
  26.    private static final String ID_BTN_ADDJOIN = "button.addjoin";
  27.    private static final String ID_BTN_REMOVEJOIN = "button.removejoin";
  28.    private static final int LIST_WIDTH = 110;
  29.    private static final int JOIN_LIST_WIDTH = 60;
  30.    JLabel _lblLhsTables;
  31.    JLabel _lblRhsTables;
  32.    JComboBox _cboLhsTables;
  33.    JComboBox _cboRhsTables;
  34.    JLabel _lblLhsFields;
  35.    JLabel _lblRhsFields;
  36.    JLabel _lblJoins;
  37.    JList _lboLhsFields;
  38.    JScrollPane _scpLhsFields;
  39.    JList _lboRhsFields;
  40.    JScrollPane _scpRhsFields;
  41.    JButton _btnAddJoin;
  42.    JList _lboJoins;
  43.    JPanel _pnlVerticalBar;
  44.    JScrollPane _scpJoins;
  45.    JButton _btnRemoveJoin;
  46.  
  47.    protected void initialize() {
  48.    }
  49.  
  50.    protected void initComponents() {
  51.       super.initComponents();
  52.       ResourceUtil ru = ((WVPanelBase)this).getResourceUtil();
  53.       JPanel contentPanel = ((WVPanelBase)this).getContentPanel();
  54.       Color bgcolor = ((Component)contentPanel).getBackground();
  55.       this._cboLhsTables = new JComboBox();
  56.       this._lblLhsTables = UiUtil.setupLabel(new JLabel(ru.getString("label.lhstables")), this._cboLhsTables);
  57.       this._lblLhsTables.setDisplayedMnemonic(ru.getMnemonic("label.lhstables"));
  58.       this._cboRhsTables = new JComboBox();
  59.       this._lblRhsTables = UiUtil.setupLabel(new JLabel(ru.getString("label.rhstables")), this._cboRhsTables);
  60.       this._lblRhsTables.setDisplayedMnemonic(ru.getMnemonic("label.rhstables"));
  61.       this._lboLhsFields = new JList();
  62.       this._lboLhsFields.setModel(new OrderedListModel());
  63.       this._lboLhsFields.setFixedCellWidth(110);
  64.       this._lboLhsFields.setSelectionMode(0);
  65.       this._scpLhsFields = new JScrollPane(this._lboLhsFields);
  66.       this._lblLhsFields = UiUtil.setupLabel(new JLabel(ru.getString("label.lhsfields")), this._lboLhsFields);
  67.       this._lblLhsFields.setDisplayedMnemonic(ru.getMnemonic("label.lhsfields"));
  68.       this._lboRhsFields = new JList();
  69.       this._lboRhsFields.setModel(new OrderedListModel());
  70.       this._lboRhsFields.setFixedCellWidth(110);
  71.       this._lboRhsFields.setSelectionMode(0);
  72.       this._scpRhsFields = new JScrollPane(this._lboRhsFields);
  73.       this._lblRhsFields = UiUtil.setupLabel(new JLabel(ru.getString("label.rhsfields")), this._lboRhsFields);
  74.       this._lblRhsFields.setDisplayedMnemonic(ru.getMnemonic("label.rhsfields"));
  75.       this._btnAddJoin = new JButton(ru.getString("button.addjoin"));
  76.       this._btnAddJoin.setMnemonic(ru.getMnemonic("button.addjoin"));
  77.       this._pnlVerticalBar = new JPanel();
  78.       this._pnlVerticalBar.setBorder(BorderFactory.createEtchedBorder());
  79.       this._pnlVerticalBar.setMinimumSize(new Dimension(2, 2));
  80.       this._pnlVerticalBar.setPreferredSize(new Dimension(2, 100));
  81.       this._lboJoins = new JList();
  82.       this._lboJoins.setModel(new OrderedListModel());
  83.       this._scpJoins = new JScrollPane(this._lboJoins);
  84.       this._lblJoins = UiUtil.setupLabel(new JLabel(ru.getString("label.joins")), this._lboJoins);
  85.       this._lblJoins.setDisplayedMnemonic(ru.getMnemonic("label.joins"));
  86.       this._btnRemoveJoin = new JButton(ru.getString("button.removejoin"));
  87.       this._btnRemoveJoin.setMnemonic(ru.getMnemonic("button.removejoin"));
  88.    }
  89.  
  90.    protected void initLayout() {
  91.       super.initLayout();
  92.       JPanel contentPanel = ((WVPanelBase)this).getContentPanel();
  93.       GridBagLayout gbl = new GridBagLayout();
  94.       GridBagConstraints gbc = new GridBagConstraints();
  95.       ((Container)contentPanel).setLayout(gbl);
  96.       gbc.ipady = 5;
  97.       UiUtil.addComponent(contentPanel, super._txpIntro, gbl, gbc, 0, 0, 5, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 0, 10, 0);
  98.       gbc.ipady = 0;
  99.       UiUtil.addComponent(contentPanel, this._lblLhsTables, gbl, gbc, 0, 1, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 0, 0, 5);
  100.       UiUtil.addComponent(contentPanel, this._lblRhsTables, gbl, gbc, 1, 1, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 5, 0, 0);
  101.       UiUtil.addComponent(contentPanel, this._pnlVerticalBar, gbl, gbc, 2, 1, 1, 5, (double)0.0F, (double)0.0F, 10, 3, 10, 7, 0, 7);
  102.       gbc.ipadx = -20;
  103.       UiUtil.addComponent(contentPanel, this._cboLhsTables, gbl, gbc, 0, 2, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 0, 0, 5);
  104.       UiUtil.addComponent(contentPanel, this._cboRhsTables, gbl, gbc, 1, 2, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 5, 0, 0);
  105.       gbc.ipadx = 0;
  106.       UiUtil.addComponent(contentPanel, this._lblLhsFields, gbl, gbc, 0, 3, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 5, 0, 0, 5);
  107.       UiUtil.addComponent(contentPanel, this._lblRhsFields, gbl, gbc, 1, 3, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 5, 5, 0, 0);
  108.       UiUtil.addComponent(contentPanel, this._lblJoins, gbl, gbc, 3, 3, 2, 1, (double)0.0F, (double)0.0F, 18, 2, 5, 0, 0, 0);
  109.       UiUtil.addComponent(contentPanel, this._scpLhsFields, gbl, gbc, 0, 4, 1, 2, (double)0.0F, (double)0.0F, 18, 1, 0, 0, 0, 5);
  110.       UiUtil.addComponent(contentPanel, this._scpRhsFields, gbl, gbc, 1, 4, 1, 2, (double)0.0F, (double)1.0F, 18, 1, 0, 5, 0, 0);
  111.       UiUtil.addComponent(contentPanel, this._scpJoins, gbl, gbc, 3, 4, 2, 1, (double)1.0F, (double)1.0F, 18, 1, 0, 0, 0, 0);
  112.       UiUtil.addComponent(contentPanel, this._btnAddJoin, gbl, gbc, 3, 5, 1, 1, (double)1.0F, (double)0.0F, 13, 0, 5, 0, 0, 0);
  113.       UiUtil.addComponent(contentPanel, this._btnRemoveJoin, gbl, gbc, 4, 5, 1, 1, (double)0.0F, (double)0.0F, 13, 0, 5, 0, 0, 0);
  114.    }
  115. }
  116.